home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
edit
/
me_cd.zip
/
TAGS.MUT
< prev
next >
Wrap
Text File
|
1988-04-04
|
2KB
|
71 lines
;; Lookup stuff in a tags file
;; To create a tags file in:
;; current directory: ctags -xtw files >Tags
;; a subtree: find . -name '*.[ch]' -print | xargs ctags -xtw >Tags
;; Keep the tags file in the directory it is created in
(include spoint.mut)
(string tags-path 150 file-name 200 text 200)
(const tag-buffer "*TAGS*")
(defun
lookup-tag (string tag) HIDDEN ; search the tags buffer for a tag
{
(bool s)
(s TRUE)(save-point)
(switch-to-buffer tag-buffer)(beginning-of-buffer)
(msg "Looking for tag ...")
(if (re-search-forward (concat '^' tag '\ '))
{
(looking-at '\ *\d+ \([^ ]+\)\ +\(.+\)')
(file-name (get-matched '\1'))
(text (get-matched '\2'))
}
{ (msg tag " not found.")(s FALSE) }
)
(restore-point)
s
}
get-tag-name HIDDEN
{
(string tag 100)
(if (== "" (tag (ask "Tag to look for: ")))
{ (looking-at '\w+')(get-matched '&') }
tag
)
}
goto-tag
{
(string tag 100)
(tag (get-tag-name))
(if (lookup-tag tag)
{
(visit-file (concat tags-path (substr file-name 1 200)))
(if (search-forward text)
{(arg-prefix 1)(reposition-window)} ; move to top of screen
(msg "tag file is out of date")
)
})
}
where-is-tag
{
(string tag 100)
(tag (get-tag-name))
(if (lookup-tag tag)
(msg tag " is in " tags-path (substr file-name 1 200)))
}
select-tag-file MAIN
{
(tags-path (ask "DIRECTORY tags file is in: "))
(save-point)
(kill-buffer tag-buffer)
(switch-to-buffer tag-buffer)(read-file (concat tags-path "/Tags"))
(buffer-flags -1 0x6)
(restore-point)
(msg "Loaded tags")
}
)